// 
package Leetcode_Second_Brush;

import java.util.StringJoiner;

public class Solution151 {
    public String reverseWords(String s) {
        String[] split = s.trim().split("\\s+");
        StringJoiner sj = new StringJoiner(" ");
        for (int i = split.length - 1; i >= 0; i--)
            sj.add(split[i]);
        return sj.toString();
    }
}
